
import oracledb
oracledb.init_oracle_client("D:\Program\python\instantclient-basic-windows.x64-23.8.0.25.04\instantclient_23_8")
conn = oracledb.connect(user='system',password='123456',dsn="localhost:1521/orcl")
cursor = conn.cursor()
cursor.execute("select * from emp")
rows = cursor.fetchall()
for r in rows:
    print(r)
conn.close()